home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-01-22 | 4.6 KB | 131 lines | [TEXT/MPS ] |
- /*------------------------------------------------------------------------------
- *
- * Apple Macintosh Developer Technical Support
- *
- * Installer 3.2 sample: adding an audit trail
- *
- * File: AddAuditTrail.r - Rez Source
- *
- * by: Jon Zap
- *
- * Copyright © 1991 Apple Computer, Inc.
- * All rights reserved.
- *
- *------------------------------------------------------------------------------
- *
- * Install "TheProgram" into the folder "Root":Installed Application and then
- * add an audit record to the system file. Note that in 3.1 there was a bug in the
- * installer that required us to touch the target file with a file or resource atom;
- * this bug has been fixed.
- *----------------------------------------------------------------------------*/
-
- #include "InstallerTypes.r"
-
- /* You can build and complete the script with the following lines:
- # Note: set up floppies with the appropriate names and contents before running scriptcheck
- # or set up folders with the same names and contents as the floppies
- # put these folders in the same folder as the script or at the root directory of same disk
-
- rez -o "AddAuditTrail" -t 'bjbc' -c 'bjbc' "AddAuditTrail.r"
- setfile -a i "AddAuditTrail" #mark Inited
- scriptcheck -p "AddAuditTrail"
- */
-
- /* put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
- #define kScriptCheckSetsDate 0x01
-
- /* Defines for the file spec atoms (specifications for source and destination files) */
- #define fsSourceProgram 2000
- #define fsTargetProgram 2001
- #define fsTargetSystem 2002
-
- /* This is the name of the source disk */
- #define ProgramDisk "Program Disk:"
-
- /* This is the target path for where we want to install the file. */
- #define TargetPath ":Installed Application:"
-
- /* Definition for the package. */
- #define pkTheProgram 3000
-
- /* Definition for the file atom */
- #define faProgram 4000
-
- /* Definition for the audit atom */
- #define atProgram 5000
- #define auditProgram 'MOOF'
- #define auditProgVer 2
-
- /***************************** Package Resources ************************************************/
- resource 'inpk' (pkTheProgram) {
- format0 {
- showsOnCustom, /* Package appears in the Custom Install display */
- removable, /* Package can be removed */
- dontForceRestart, /* adding an audit atom to system file doesn't require reboot */
- 0, /* 'icmt' not required */
- 0, /* Package size (filled in by ScriptCheck) */
- "The Program audit", { /* package name */
- 'infa', faProgram;
- 'inat', atProgram;
- }
- }
- };
-
- /********************************************* File Specs ***************************************/
- /* Source File Specs */
- resource 'infs' (fsSourceProgram) {
- 'APPL', /* File Type */
- 'Arfz', /* Creator */
- kScriptCheckSetsDate, /* ScriptCheck will fill in the creation date */
- noSearchForFile, /* Do not search the source disk for the file */
- typeCrMustMatch, /* file type and creator on this file must match */
- ProgramDisk"TheProgram" /* Path to the file */
- };
-
- /* Target File Specs */
- resource 'infs' (fsTargetProgram) {
- 'APPL', /* File Type */
- 'Arfz', /* Creator */
- 0, /* not needed for target file spec */
- noSearchForFile, /* Do not search the target disk for the file */
- typeCrMustMatch, /* not needed for target file specs */
- TargetPath"TheProgram" /* installation Path */
- };
-
- resource 'infs' (fsTargetSystem) {
- 'ZSYS', /* File Type */
- 'MACS', /* Creator */
- 0, /* not needed for target file spec */
- noSearchForFile, /* Do not search the target disk for the file */
- typeCrNeedNotMatch, /* not needed for target file specs */
- "Blessed:System" /* installation Path */
- };
-
- /***************************************** File Atoms ************************************************/
- resource 'infa' (faProgram) {
- format0 {
- deleteWhenRemoving, /* Delete the file if remove (option-custom) is clicked */
- dontDeleteWhenInstalling, /* don't need to predelete the target before copying new one */
- copy, /* Copy the file to the destination */
- leaveAloneIfNewer, /* do not Install this version, if newer one exists */
- updateExisting, /* replace an existing copy, if mine is newer */
- noUpdateOnly, /* Copy whether the target file exists or not */
- rsrcFork, dataFork, /* Copy both forks of the file */
- fsTargetProgram, /* TARGET file spec */
- fsSourceProgram, /* SOURCE file spec */
- 0, /* atom size (filled in by ScriptCheck) */
- "" /* Atom Description (for a file Installer will use file name) */
- };
- };
-
- resource 'inat' (atProgram) {
- format0 {
- fsTargetSystem,
- auditProgram,
- auditProgVer
- };
- };
-
-
-
-